/**
 * 
 */
package it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.actions;

import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.pawn.Character;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.pawn.GenericPawn;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.player.SimplePlayer;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.world.Chessboard;

/**
 * @author Massimo Canonaco
 *
 */
public abstract class AbstractCharacterAction implements GenericLogicAction{

	/** */
	protected Character character;
	
	/** */
	protected SimplePlayer performer;
	
	/** */
	protected boolean end;
	
	/** */
	protected Chessboard park;
	
	/** */
	protected ChessboardPointCoordinate targetPoint;
	
	/** */
	public AbstractCharacterAction(SimplePlayer performer, Chessboard arena)
	{
		this.performer = performer;
		park = arena;
		targetPoint = new ChessboardPointCoordinate();
	}
	
	/** */
	@Override
	public boolean isFinished() {
		return end;
	}
	
	/** */
	protected Character getCharacter(final int row, final int column)
	{
		GenericPawn temp = park.getPawn(row, column);
		if(temp == null) 
		{
			return null;
		}
		return (Character)temp;
	}
	
}
